<?php
namespace MSDK\Controller;

/**
 * 通用上传处理控制器
 * 
 * @since 1.0.0 <2015-3-28> SoChishun <14507247@qq.com> Added.
 */
class UploadHandlerController extends AppbaseController {
        
    /**
     * kindeupload操作
     * @since 1.0 2015-3-28 SoChishun Added.
     */
    public function kindeupload() {
        $msg=sofn_upload(array('savePath'=>'Product/','maxSize'=>500*1024*1024,'skipEmpty'=>true));
        if(is_array($msg)){
            $result=array('error' => 0, 'url' =>$msg['imgFile']['filepath']);
        }else{
            $result=array('error' => 1, 'message' => $msg);
        }
        $this->ajaxReturn($result);
    }
}